<div>
    <label>Message</label>:
    <div align="center">
        <?php echo CHtml::textArea('log', '', array('cols'=>70, 'rows'=>7, 'class'=>'log-content'));?>
    </div>
    <div align="right"><?php echo CHtml::button('Cancel', array('class'=>'cancel-log'));?><?php echo CHtml::button('Save', array('class'=>'save-log'));?></div>
</div>
<?php
$script = "
jQuery('.save-log').click(function(){
    var text = jQuery('.log-content').val();
    var str = text.replace(/\s+/m, '');
    if (str.length)
        parent.jQuery.save_new_revision(text);
    else
        alert('You must enter a log message for the new revision');
});
jQuery('.cancel-log').click(function(){
    parent.jQuery.fancybox.close();
});
jQuery('.ContentContainer').removeClass('ContentContainer');
";
Yii::app()->clientScript->registerScript('SaveLog', $script, CClientScript::POS_READY);
?>
